<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/

Route::get('/', function()
{
	//return View::make('hello');
	return Redirect::to('mapa');
});

/*
|-----------------------------------------------------------------------------------------------------------------
| Games Routes
|-----------------------------------------------------------------------------------------------------------------
*/

Route::get('jogos', 								array(	'as'	=>  'jogos',
															'uses'	=>  'GamesController@listGames'));

Route::post('jogos/eliminar', 						array(	'as'	=>	'eliminarJogo',
															'uses'	=>	'GamesController@deleteGame'));

Route::post('jogos/activar',						array(	'as'	=>	'activarJogo',
															'uses'	=>	'GamesController@activateGame'));

//----------------------------------------------------------------------------------------------------------------

Route::get('novojogo',								array(	'as'   	=>  'novojogo',
															'uses' 	=>  'GamesController@newGame'));

Route::post('novojogo/equipas',						array(	'as'   	=>  'criarnovojogo',
															'uses' 	=>  'GamesController@createNewGame'));

Route::post('novojogo/equipas/criar',				array(	'as'   	=>  'definirEquipas',
															'uses' 	=>  'GamesController@setTeams'));

//----------------------------------------------------------------------------------------------------------------

Route::get('jogos/{id}/editar',						array(	'as'   	=>  'editar',
															'uses' 	=>  'GamesController@editGame'));

Route::post('jogos/{id}/editar/editar',				array(	'as'   	=>  'definirEquipas',
															'uses' 	=>  'GamesController@editTeams'));

/*
|----------------------------------------------------------------------------------------------------------------
| Map Routes
|----------------------------------------------------------------------------------------------------------------
*/

Route::get('mapa',									array(	'as'   => 'mapa',
															'uses' => 'MapController@map'));


/*
|--------------------------------------------------------------------------
| Meteo Routes
|--------------------------------------------------------------------------
*/

Route::get('meteo/{id}', 							array(	'as'  	=> 'meteo',
															'uses' 	=> 'MeteoController@meteo'));

Route::get('meteo/{id}/previsao', 					array(	'as'	=> 'nextDay',
															'uses'	=> 'MeteoController@nextDay'));




/*
|--------------------------------------------------------------------------
| Counter Routes
|--------------------------------------------------------------------------
*/

Route::get('contador', 								array(	'as'   => 'contador',
															'uses' => 'CounterController@counter'));



/*
|--------------------------------------------------------------------------
| Result Routes
|--------------------------------------------------------------------------
*/

Route::get('resultados', 							array(	'as'   	=> 'resultados',
															'uses' 	=> 'ResultController@result'));

Route::post('resultados/obter', 					array(	'as'	=> 'obterResultados',
															'uses'	=> 'ResultController@ranking'));

/*
|--------------------------------------------------------------------------
| Cronometro Routes
|--------------------------------------------------------------------------
*/

Route::get('cronometro', 							array(	'as'   => 'cronometro',
															'uses' => 'CronometroController@cronometro'));


//----------------------------------------------------------------------------
Route::get('poca', array('uses' => 'PocaController@poca'));